import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import particlesJs from "particles.js"
import moment from 'moment'
import echarts from 'echarts'
import './elementConfig'
import './assets/css/reset.css'
import './assets/css/modifyElement.css'

Vue.config.productionTip = false
Vue.use(particlesJs)
Vue.prototype.$moment = moment;
Vue.prototype.$echarts = echarts;

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')

router.beforeEach((to, from, next) => {
  const CHANGE_BG = '/login';
  if (to.path == CHANGE_BG) {
    store.commit('changeBg','login');
    sessionStorage.setItem('isBg','login');
  } else {
    store.commit('changeBg','noLogin');
    sessionStorage.setItem('isBg','noLogin');
  }
  next()
})
